#include <cstdio>
#include <stack>
#include <string>
#include <iostream>
using namespace std;
const int N = 205;
string s;
stack <int> a;
int cnt, tmp, d[] = {0, 1, 10, 100};
int main() {
	cin >> s;
	for (int i = 0; i < s.size(); i++) {
		if (s[i] <= '9' && s[i] >= '0') {
			int j = i;
			while (s[j] != '.') {
				j++;
				cnt++;
			}
			int x = s[i] - '0';
			x *= d[cnt];
			tmp += x;
		} else if (s[i] == '.') {
			cnt = 0;
			a.push (tmp);
			tmp = 0;
		} else if (s[i] == '+') {
			int x = a.top();
			a.pop();
			int y = a.top();
			a.pop();
			a.push(x + y);
		}  else if (s[i] == '*') {
			int x = a.top();
			a.pop();
			int y = a.top();
			a.pop();
			a.push(x * y);
		}  else if (s[i] == '-') {
			int x = a.top();
			a.pop();
			int y = a.top();
			a.pop();
			a.push(y - x);
		} else if (s[i] == '@') {
			printf ("%d\n", a.top());
			break;
		}
	}
	return 0;
}
